<template>
  <div
      v-if="hasPerm(['system:druid'])"
      class="w-[100%]"
      style="height: calc(100% - 50px)"
  >
    <iframe :src="druidUrl" class="w-[100%] h-[100%]"></iframe>
  </div>
  <div
      v-else
      class="w-[100%] flex items-center"
      style="height: calc(100% - 50px)"
  >
    <a-empty>
      <template #image>
        <icon-close-circle-fill/>
      </template>
      <span>暂无访问权限，请联系管理员分配权限</span>
    </a-empty>
  </div>
</template>
<script setup>
import {onMounted, ref} from "vue";
import {hasPerm} from "~/utils/sys.js";
import {druidLoginApi} from "../../../api/basic/druid.js";

const druidUrl = ref("http://localhost:9090/minimalist/druid/login.html");

onMounted(() => {
  druidLoginApi({ignore: 1}).then(() => {
    druidUrl.value = "http://localhost:9091/minimalist/druid/index.html";
  });
});
</script>
<style scoped></style>
